package com.meeruu.sg.account.core.api.exception;

import lombok.Getter;

import java.io.Serializable;

/**
 * @Auther: liwu
 * @Date: 2019/5/14 16:08
 * @Description:
 */
@Getter
public enum ErrorCode implements Serializable {


    /**
     * 校验相关 1001 - 1099
     */
    PARAM_ERROR(1001, "参数异常"),
    REQUEST_NO_EMPTY(1002, "请求流水号不能为空"),

    /***
     * 业务相关
     */
    BIZ_EXEC_FLEQUENT(2001, "业务处理频繁，请稍后再试"),


    /**
     * 账户相关
     */
    BIZ_ACCOUNT_NOT_EXIST(2100, "账户不存在"),
    BIZ_ACCOUNT_STATUS_ERROR(2101, "状态异常"),
    BIZ_ACCOUNT_REQUEST_NOT_EXIST(2102, "账户类型请求不存在"),
    BIZ_ACCOUNT_EXIST(2103, "账户已存在"),
    BIZ_ACCOUNT_NAME_EXIST(2104, "账户名称已存在"),
    BIZ_BALANCE_NOT_ENOUGH(2110, "账户金额不足"),
    BIZ_FROZEN_BALANCE_NOT_ENOUGH(2111, "账户冻结金额金额不足"),

    BIZ_FROZEN_FLOW_NOT_EXIST(2200, "冻记录不存在"),
    BIZ_FROZEN_FLOW_VALID(2201, "冻记录已失效（已被消费）"),

    BIZ_OPR_STATUS_ERROR(2300, "账户状态变更异常"),

    BIZ_REQUEST_FLOW_EXIST_ERROR(2400, "请求流水正在处理或处理成功"),
    BIZ_ACCOUNT_TYPE_NOT_SUPPORT(2500, "账户类型不支持"),

    /**
     * 操作库
     */
    DELETE_FAILURE(50101,"删除失败"),
    ADD_FAILURE(50102,"添加失败"),
    MODIFY_FAILURE(50103,"修改失败"),

    /**
     * 提现相关
     */
    LOAD_SYS_ERROR(50001, "加载配置失败"),
    SYS_EXCEPTION(50002, "配置异常或不存在"),


    ;

    private Integer code;
    private String message;

    ErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
